package ch03.shiLi.service.impl;

import ch03.shiLi.util.News;
import ch03.shiLi.dao.NewsDao;
import ch03.shiLi.service.NewsService;

//业务类
public class NewsServiceImpl implements NewsService {
    private NewsDao dao;//实例化所依赖的NewsDao对象new NewsDaoImpl()


    public void setDao(NewsDao dao) {
        this.dao = dao;
    }

    public NewsDao getDao() {
        return dao;
    }

    @Override
    public void addNews(News news){
        //调用NewsDao的方法保存新闻信息
        dao.save(news);
    }
}
